package com.study.fetch.rk;

import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @author zhuzi
 * 2025/1/22 17:44
 */
public interface DataDTO {
    /**
     * 腾讯自选股
     */
    @Data
    @Accessors(chain = true)
    class TxzxgData implements Serializable {

        private Long id;
        private String bondId;
        private String bondName;
        private LocalDate date;
        private BigDecimal open;
        private BigDecimal last;
        private BigDecimal high;
        private BigDecimal low;
        private BigDecimal volume;
        private BigDecimal amount;

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof TxzxgData)) return false;
            TxzxgData txzxgData = (TxzxgData) o;
            return new EqualsBuilder().append(bondId, txzxgData.bondId).append(date, txzxgData.date).isEquals();
        }

        @Override
        public int hashCode() {
            return new HashCodeBuilder(17, 37).append(bondId).append(date).toHashCode();
        }
    }
}
